package TrafficControlSystem.Common;

import TrafficControlSystem.TrafficServer.Logger;



public abstract class CarsInfoSerializer extends Serializer {	
	public static String toXML(CarsInfo cars) {
		long start = System.currentTimeMillis();
		String xml = xstream.toXML(cars);
		long end = System.currentTimeMillis();
		Logger.log("CARS TO XML TIME: " + Long.toString(end - start));
		return xml;
	}
	
	public static CarsInfo fromXML(String xml) {
		long start = System.currentTimeMillis();
		CarsInfo info = (CarsInfo)xstream.fromXML(xml);
		long end = System.currentTimeMillis();
		Logger.log("CARS FROM XML TIME: " + Long.toString(end - start));
		return info;
	}
	
}
